package com.cloudfun.msglisten.repo;

import com.cloudfun.msglisten.common.constant.SysDictType;
import com.cloudfun.msglisten.entity.SystemDictionaryEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by Huqin on 2019/12/28
 */
public interface SystemDictionaryEntityRepo extends
        PagingAndSortingRepository<SystemDictionaryEntity, String>,
        JpaSpecificationExecutor<SystemDictionaryEntity> {

    SystemDictionaryEntity findByKey(String key);

    SystemDictionaryEntity findByTypeAndKey(SysDictType type, String key);

    List<SystemDictionaryEntity> findAllByType(SysDictType type);

}
